/* 上传控件 */
$file-card-width: 60px !default; // 卡片式文件列表项宽度
$file-card-height: 60px !default; // 卡片式文件列表项高度
$file-text-width: 24px !default; // 文本式文件列表项宽度
$file-text-height: 24px !default; // 文本式文件列表项高度
$file-card-bg: #edf5ff !default; // 文件卡片背景
$file-item-hover-bg: #edf2f7 !default; // 文件项滑过背景
$file-progress-bg: #d3dce7 !default; // 进度条背景色
$file-progress-color: #78cf70 !default; // 进度条颜色
$file-item-hover-bg: #edf2f7 !default; // 文件项滑过背景

// upload: 包装容器
.tw-upload .el-upload {
  text-align: left;
}

// upload: 添加按钮
.el-upload .tw-addbtn {
  vertical-align: top;
}

// upload: 文件列表(默认为卡片式)
.tw-upload-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 (-$spacing-tiny);
}

// upload: 文件列表项
.tw-upload-list-item {
  display: flex;
  padding: $spacing-tiny;
}

// upload: 文件
.tw-upload-file {
  position: relative;
  width: $file-card-width;
  height: $file-card-height;
  overflow: hidden;
  cursor: pointer;
  background: #edf5fc;
}

.tw-upload-percentage {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 100%;
  background: #000;
  opacity: .65;
  transition: all $time linear;
}

.tw-upload.xdisabled .tw-upload-percentage {
  display: none;
}

// upload: 文件-图片
.tw-upload-file > img {
  position: relative;
  left: 50%;
  min-width: 100%;
  height: 100%;
  transform: translateX(-50%);
}

// upload: 文件-删除按钮
.tw-upload-file > .tw-ico.xuldel1 {
  position: absolute;
  top: 0;
  right: -2px;
  z-index: 1;
  cursor: pointer;
  opacity: .8;

  &:hover {
    opacity: 1;
  }
}

.tw-upload-file:hover > .tw-ico {
  display: block;
}

// upload: 文件上传进度条
.tw-upload-file-process {
  position: absolute;
  top: 50%;
  right: $spacing-tiny;
  left: $spacing-tiny;
  z-index: 1;
  margin-top: -3px;
}

.tw-upload-file-process .el-progress-bar {
  padding-right: 0;
  margin-right: 0;
}

.tw-upload-file-process .el-progress-bar__outer {
  background-color: $file-progress-bg;
}

.tw-upload-file-process .el-progress-bar__inner {
  background-color: $file-progress-color;
}

// upload: 文件列表(文本式)
.tw-upload-list.xtext {
  flex-direction: column;
  align-items: stretch;
  margin-top: $spacing-tiny;
}

.tw-upload-list.xtext > li {
  padding: 0;
}

.tw-upload.xdisabled .tw-upload-list.xtext {
  margin-top: 0;
}

.tw-upload-file.xtext {
  display: flex;
  align-items: center;
  width: 100%;
  height: auto;
  padding: $spacing-tiny;
  background: transparent;

  &:hover {
    background: $file-card-bg;
  }
}

.tw-upload-file-imgbox {
  position: relative;
  width: $file-text-width;
  height: $file-text-height;
  overflow: hidden;
  background: #edf5fc;
}

.tw-upload-file-imgbox > img {
  position: relative;
  left: 50%;
  height: 100%;
  transform: translateX(-50%);
}

.tw-upload-file-name {
  flex: 1;
  padding-left: $spacing-step;

  @include ellipsis;
}

.tw-upload-file-tools {
  padding-left: $spacing-tiny;
}

.tw-infobox.xreadonly .tw-upload-list {
  margin-left: 62px;
}

.tw-infobox.xreadonly .xfull {
  margin-left: -$spacing-tiny;
}

.tw-infobox.xreadonly .xfull .tw-upload-list {
  margin-left: 0;
}

// upload: 禁用
.tw-upload.xdisabled > div:first-child {
  display: none;
}
// upload 禁用图片尺寸
.tw-upload.xdisabled .tw-upload-file.xcard{
  width:80px;
  height: 80px;
}

.tw-upload.xdisabled .tw-upload-list-item{
  padding: $spacing-tiny $spacing-step;
}


.tw-upload-cover {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10000;
  background: transparent;
}


.el-upload__tip {
  font-size: $font-size-default;
  color: $color-text-weaking;
}

//文本式删除按钮默认不显示
.tw-upload-list-item .tw-ico.xuldel2 {
  display: none;
}
.tw-upload-list-item:hover .tw-ico.xuldel2{
  display: inline-block;
}